

package com.hazelcast.sql.impl.security;

import javax.security.auth.Subject;
import java.security.Permission;

/**
 * SQL security that is used when the security is disabled. Does nothing.
 */
public final class NoOpSqlSecurityContext implements SqlSecurityContext {

    public static final NoOpSqlSecurityContext INSTANCE = new NoOpSqlSecurityContext();

    private NoOpSqlSecurityContext() {
        // No-op.
    }

    @Override
    public boolean isSecurityEnabled() {
        return false;
    }

    @Override
    public void checkPermission(Permission permission) {
        // No-op.
    }

    @Override
    public Subject subject() {
        return null;
    }
}
